home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / ASM-ALPH.{_4 / FLOPPY.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  2KB  |  75 lines

  1. /*
  2.  * Architecture specific parts of the Floppy driver
  3.  *
  4.  * This file is subject to the terms and conditions of the GNU General Public
  5.  * License.  See the file "COPYING" in the main directory of this archive
  6.  * for more details.
  7.  *
  8.  * Copyright (C) 1995
  9.  */
  10. #ifndef __ASM_ALPHA_FLOPPY_H
  11. #define __ASM_ALPHA_FLOPPY_H
  12.  
  13. #include <linux/config.h>
  14.  
  15. #define fd_inb(port)            inb_p(port)
  16. #define fd_outb(port,value)        outb_p(port,value)
  17.  
  18. #define fd_enable_dma()         enable_dma(FLOPPY_DMA)
  19. #define fd_disable_dma()        disable_dma(FLOPPY_DMA)
  20. #define fd_request_dma()        request_dma(FLOPPY_DMA,"floppy")
  21. #define fd_free_dma()           free_dma(FLOPPY_DMA)
  22. #define fd_clear_dma_ff()       clear_dma_ff(FLOPPY_DMA)
  23. #define fd_set_dma_mode(mode)   set_dma_mode(FLOPPY_DMA,mode)
  24. #define fd_set_dma_addr(addr)   set_dma_addr(FLOPPY_DMA,virt_to_bus(addr))
  25. #define fd_set_dma_count(count) set_dma_count(FLOPPY_DMA,count)
  26. #define fd_enable_irq()         enable_irq(FLOPPY_IRQ)
  27. #define fd_disable_irq()        disable_irq(FLOPPY_IRQ)
  28. #define fd_cacheflush(addr,size) /* nothing */
  29. #define fd_request_irq()        request_irq(FLOPPY_IRQ, floppy_interrupt, \
  30.                         SA_INTERRUPT|SA_SAMPLE_RANDOM, \
  31.                             "floppy", NULL)
  32. #define fd_free_irq()           free_irq(FLOPPY_IRQ, NULL);
  33.  
  34. __inline__ void virtual_dma_init(void)
  35. {
  36.     /* Nothing to do on an Alpha */
  37. }
  38.  
  39. static int FDC1 = 0x3f0;
  40. static int FDC2 = -1;
  41.  
  42. /*
  43.  * Again, the CMOS information doesn't work on the alpha..
  44.  */
  45. #define FLOPPY0_TYPE 6
  46. #define FLOPPY1_TYPE 0
  47.  
  48. #define N_FDC 2
  49. #define N_DRIVE 8
  50.  
  51. #define FLOPPY_MOTOR_MASK 0xf0
  52.  
  53. /*
  54.  * Most Alphas have no problems with floppy DMA crossing 64k borders,
  55.  * except for XL and RUFFIAN.  They are also the only one with DMA
  56.  * limits, so we use that to test in the generic kernel.
  57.  */
  58.  
  59. #define __CROSS_64KB(a,s)                    \
  60. ({ unsigned long __s64 = (unsigned long)(a);            \
  61.    unsigned long __e64 = __s64 + (unsigned long)(s) - 1;    \
  62.    (__s64 ^ __e64) & ~0xfffful; })
  63.  
  64. #ifdef CONFIG_ALPHA_GENERIC
  65. # define CROSS_64KB(a,s)   (__CROSS_64KB(a,s) && ~alpha_mv.max_dma_address)
  66. #else
  67. # if defined(CONFIG_ALPHA_XL) || defined(CONFIG_ALPHA_RUFFIAN)
  68. #  define CROSS_64KB(a,s)  __CROSS_64KB(a,s)
  69. # else
  70. #  define CROSS_64KB(a,s)  (0)
  71. # endif
  72. #endif
  73.  
  74. #endif /* __ASM_ALPHA_FLOPPY_H */
  75.